package week_home_work02;

import java.util.Scanner;

/**
 * @author zdl
 * @date 2024/11/23
 */
public class Demo63 {
    public static void main(String[] args) {
        //输出正整数n的所有因子的平方和。
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个整数:");
        int num = sc.nextInt();
        int sum = 0;
        for (int i = 1; i <= num; i++) {
            if (num % i == 0) {
                System.out.print(i + "\t");
                sum += i * i;
            }
        }
        System.out.println();
        System.out.println(sum);
    }
}
